﻿@model IEnumerable<MatchPlayResult>

<table class="table table-hover">
    @foreach (MatchPlayResult r in Model.OrderByDescending(d => d.Date))
    {
        <tr>
            <td>@r.Date.ToLongDateString()
                @if (@r.HolesUp == 0)
                {
                    string s = string.Format("spillede {0} og {1} A/S", r.Player1.DisplayName, r.Player2.DisplayName);
                    @s
                }
                else
                {
                    string opp = r.Player1.DisplayName;
                    if (r.WinnerPlayerId == r.Player1Id)
                    {
                        opp = r.Player2.DisplayName;
                    }
                    string s = string.Format("vandt {0} {1}UP over {2}", r.WinningPlayer.DisplayName, r.HolesUp, opp);
                    @s
                }
            </td>
        </tr>
    }
</table>